var mysql =  require('mysql')


var connection = mysql.createConnection({
    host       :'localhost',
    user       :'root',
    password   :'1234',
    port        :'3306',
    database    :'test'
});

connection.connect();

var mysql = 'UPDATE ceshi2 SET name = ? WHERE id=?';
var mysqlParams = ['liu',11];

connection.query(mysql,mysqlParams,function (err,result) {
    if(err){
        console.log('[UPDATE ERROR] - ',err.message());
        return;
    }
    console.log('--------------------------UPDATE----------------------------');
    console.log('UPDATE affectedRows',result.affectedRows);
    console.log('-----------------------------------------------------------------\n\n');
})

connection.end()